import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;

import javax.imageio.ImageIO;

import com.kitfox.svg.*;
import com.kitfox.svg.animation.AnimationElement;


public class Mainclass {
	
	SVGUniverse universe;
	String path;
	File file;
	
	public Mainclass() throws URISyntaxException, SVGException, IOException{
		file=new File("/Users/Lorenzo/Pictures/diagramma.svg");
		universe= new SVGUniverse();
		universe.loadSVG(file.toURL());
		SVGDiagram diagram = universe.getDiagram(file.toURL().toURI());
		SVGElement element=diagram.getElement("path2985-4");
        //element.setAttribute("stroke-width", AnimationElement.AT_CSS, "10");
        //element.updateTime(0f);
		String s=element.getParent().getId();
		diagram.getElement(s).setAttribute("id", AnimationElement.AT_XML, "Rettangolo");
		System.out.println(element.getParent().getId());
		String c=diagram.getXMLBase().getPath();
		//File svgFile = File.createTempFile("graphic-", ".svg");
		
		System.out.println(c);
	}
	
	
}
